package org.myspringframework.beans.factory.config.postprocessor;

import org.myspringframework.beans.BeansException;
import org.myspringframework.beans.factory.config.beandefinition.PropertyValues;

/**
 * Subinterface of {@link BeanPostProcessor} that adds a before-instantiation callback,
 * and a callback after instantiation but before explicit properties are set or
 * autowiring occurs.
 */
public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor {

    /**
     * 在 Bean 实例化之前被调用，允许返回一个代理对象，从而可以在 Bean 实例化的过程中进行定制，例如创建代理对象等。
     */
    Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException;

    // 在 Bean 对象实例化完成后，设置属性操作之前执行此方法
    PropertyValues postProcessPropertyValues(PropertyValues pvs, Object bean, String beanName) throws BeansException;


}